﻿namespace ApiTemplate.WebApi
{
    /// <summary>
    /// 注入用户信息
    /// </summary>
    public static class CurrentUserSetup
    {
        /// <summary>
        /// 注入用户信息
        /// </summary>
        /// <param name="services"></param>
        public static void AddCurrentUserSetup(this IServiceCollection services)
        {
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            services.AddScoped<ICurrentUser, CurrentUser>();
        }
    }
}
